﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>微街秀 > 已发记录</title>
    <link href="plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/css.css" />
    <link rel="stylesheet" type="text/css" href="css/base.css" />
    <link href="css/gl.css" rel="stylesheet" type="text/css" />
    <link href="css/OrginArticle.css" rel="stylesheet" type="text/css" />
    <style>
        .tab
        {
            border-bottom: 1px solid gray;
            line-height: 46px;
            font-size: 16px;
            text-align: center;
        }
        .tab-active
        {
            border-bottom: 2px solid #F37B0B;
            color: #F37B0B;
        }
        .tab-fc-client
        {
            color: Gray;
            margin-left: -15px;
            margin-right: -15px;
        }
        .tab-fc-client .media
        {
            margin-left: 15px;
            margin-right: 15px;
        }
        .tab-fc-client .left-date
        {
            width: 85px;
        }
        .tab-fc-agent, .tab-fc-yy
        {
            margin-left: -15px;
            margin-right: -15px;
        }
        .fc-title
        {
            height: 42px;
        }
        .fc-num
        {
            line-height: 36px;
            padding-left: 26px;
            position: relative;
            color: #b0b0b0;
        }
        .fc-num > img
        {
            height: 25px;
            width: auto;
            position: absolute;
            left: 0px;
            top: 7px;
        }
        .bg-hui
        {
            background-color: #b0b0b0;
        }
        .gray
        {
            color: #b0b0b0;
        }
        .bb
        {
            border-bottom: 1px solid #d6d5d4;
        }
        .pl10 .pr10 div
        {
            width: 50px;
            height: 19px;
        }
    </style>
</head>
<body>
    <div>
        <div class="media top-nav-body">
            <div class="media-left back">
                <div class="top-left">
                    <i class="fa fa-angle-left"></i>
                </div>
            </div>
            <div class="media-body">
                <div class="top-title">
                    已发记录</div>
            </div>
            <div class="media-right">
                <div class="top-right">
                </div>
            </div>
        </div>
    </div>
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-4 tab" tab="1">
                所有记录</div>
            <div class="col-xs-4 tab" tab="2">
                原创记录</div>
            <div class="col-xs-4 tab" tab="3">
                转发记录</div>
        </div>
        <div class="tab-fc-client tg_select1" tabindex="1">
         
        </div>
        <div class="tab-fc-agent tg_select2" tabindex="2">
        </div>
        <div class="tab-fc-yy tg_select3" tabindex="3">
        </div>
    </div>
    <input type="hidden" id="pagecount2" value="10" />
    <input type="hidden" id="pagecount3" value="10" />
    <input type="hidden" id="countnum2" value="10" />
    <input type="hidden" id="countnum3" value="10" />
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script>

        var tag_cerent = 1;
        var pagecount = "0", pagecount3;
        var page = 1;

        $(function () {
            bindClick();
            init();
        });

        function init() {
            var tag = getQueryString("tag");
            if (tag == 2)
                $(".tab").eq(1).click();
            else if (tag == 3)
                $(".tab").eq(2).click();
            else
                $(".tab").eq(0).click();

            $(".back").bind("click", function () {
                if (document.referrer == null || document.referrer.toString().indexOf("fl_detail") > -1)
                    document.location.href = 'personal.html'
                else
                    goBack();
            });
        }

        //绑定点击事件
        function bindClick() {
            $(".tab").on("click", function () {
                $(".tab").removeClass("tab-active");
                $(this).addClass("tab-active");

                //得到选项卡序号
                var tabIndex = $(this).attr("tab");
                $("div[tabindex]").hide();
                $("div[tabindex = '" + tabIndex + "']").show();
                tag_cerent = tabIndex;
                $(".tg_select" + tag_cerent).html("");

                if (tag_cerent == 1)
                    GetList_FL(1);
                if (tag_cerent == 3)
                    GetList_ZF(1);
                else if (tag_cerent == 2)
                    GetList(1);
            });
        }

        //所有记录
        function GetList_FL(page2) {
            if (pagecount == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            ajax.GetSharelist("is_other=0&page_index=" + page, function (data) {
                if (data.code == "4") { Alert(data.msg.toString()); pagecount = "1"; return; }
                if (data.item.pageCount < page) {
                    if (pagecount == "0")
                        Alert('到底了！');
                    pagecount = "1"; return;
                }
                $(".countnum").html(data.item.itemCount + " 条");
                loadhtml_FL(data);
            });
        }

        //原创记录
        function GetList(page) {
            if ($("#pagecount" + tag_cerent).val() == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            var hannelid = '';
            var keyword = '';
            var param = "channel_id=" + hannelid + "&author_id=" + userid + "&key_word=" + keyword + "&page_index=" + page;
            ajax.getarticleList(param, function (data) {
                if (data.code == "4") { Alert(data.msg.toString()); $("#pagecount" + tag_cerent).val("1"); return; }

                if (data.item.pageCount > 0 && data.item.pageCount < page) {
                    if ($("#pagecount" + tag_cerent).val() == "0")
                        Alert('到底了！');
                    $("#pagecount" + tag_cerent).val("1"); return;
                }
                loadhtml(data);
            });
        }

        //转发记录
        function GetList_ZF(page) {
            if ($("#pagecount" + tag_cerent).val() == "1") { return; }
            if (!islogin()) { window.location.href = 'login.html'; return; }
            ajax.GetSharelist("is_other=1&page_index=" + page, function (data) {
                if (data.code == "4") { Alert(data.msg.toString()); $("#pagecount" + tag_cerent).val("1"); return; }
                if (data.item.pageCount > 0 && data.item.pageCount < page) {
                    if ($("#pagecount" + tag_cerent).val() == "0")
                        Alert('到底了！');
                    $("#pagecount" + tag_cerent).val("1"); return;
                }
                loadhtml_ZF(data);
            });
        }

        function loadhtml(data) {
            $(data.item.table).each(function () {
                var logoimg = this.logo == null ? "img/30.png" : this.logo;
                var titles = this.title;
                if (titles.length > 12)
                    titles = titles.substr(0, 12) + "...";

                $(".tg_select" + tag_cerent).append("<div class=\"centenlist\"><div class=\" centenimg\"><img src=\"" + logoimg + "\"  /></div><div class=\"cententxt\"  onclick=\"window.location.href='to_detail.aspx?article_id=" + this.id + "'\"><div class=\"cententxttop\"><strong>" + titles + "</strong></div><div class=\"centenTime\"><div class=\"centenpostion\">" + this.date.substr(0, 10) + "<div class=\"centenflow\">  <img src=\"img/flow.jpg\"> " + this.click + "</div></div><div class=\"check\"><img src=\"img/Delete2.jpg\" class=\"checkimg\" onclick=\"DelItem(2,'" + this.id + "',event)\"  /><input type=\"hidden\" name=\"checkid\" value=\"" + this.id + "\" /></div></div></div></div>");
            });
        }
        function loadhtml_ZF(data) {
            $(data.item.table).each(function () {
                num++;
                var logoimg = this.article_logo == null ? "img/30.png" : this.article_logo;
                var titles = "";
                if (this.type == 1)
                    titles = this.article_title;
                else if (this.type == 2) {
                    titles = this.url_title;
                    if (this.url_logo != null && this.url_logo != "")
                        logoimg = this.url_logo;
                }
                if (titles != null && titles.length > 12)
                    titles = titles.substr(0, 12) + "...";
                $(".tg_select" + tag_cerent).append("<div class=\"centenlist\"><div class=\" centenimg\"><img src=\"" + logoimg + "\"  /></div><div class=\"cententxt\"  onclick=\"window.location.href='to_detail.aspx?article_id=" + this.id + "'\"><div class=\"cententxttop\"><strong>" + titles + "</strong></div><div class=\"centenTime\"><div class=\"centenpostion\">" + this.date.substr(0, 10) + "<div class=\"centenflow\">  <img src=\"img/flow.jpg\"> " + this.click + "</div></div><div class=\"check\"><img src=\"img/Delete2.jpg\" class=\"checkimg\" onclick=\"DelItem(3,'" + this.id + "',event)\" /><input type=\"hidden\" name=\"checkid\" value=\"" + this.id + "\" /></div></div></div></div>");
            });
        }

        var num = 0;
        function loadhtml_FL(data) {
            $(data.item.table).each(function () {
                num++;
                var logoimg = this.article_logo == null ? "img/30.png" : this.article_logo;
                var titles;
                if (this.type == 1)
                    titles = this.article_title;
                else if (this.type == 2) {
                    titles = this.url_title;
                    if (this.url_logo != null && this.url_logo != "")
                        logoimg = this.url_logo;
                }
                if (titles == null) titles = "";
                if (titles.length > 12)
                    titles = titles.substr(0, 12) + "...";

                var url = "detail.aspx?is_app=1&shareid=" + this.id + "&advert_id=" + this.advert_id + "&article_id=" + this.article_id + "&type=" + this.type;
                $(".tg_select" + tag_cerent).append("<div class=\"centenlist\"><div class=\" centenimg\"><img src=\"" + logoimg + "\"  /></div><div class=\"cententxt\" onclick=\"window.location.href='" + url + "'\" ><div class=\"cententxttop\"><strong>" + titles + "</strong></div><div class=\"centenTime\">" + this.date.substr(0, 10) + "<div class=\"centenflow\" style='width:100px;' name=\"" + this.id + "\" > <div style='width: 50px;float: left;'  ><img src=\"img/flow.jpg\" class=\"imgclick\" name=\"" + this.id + "\" /> " + this.click + "</div> <div><img src=\"img/dianji1.png\"  class=\"imgclick\" name=\"" + this.id + "\" /> " + this.ad_click + "</div></div><div tag=\"" + this.article_id + "\" class=\"check\" onclick=\"DelItem1('" + this.id + "','" + this.article_id + "',event)\" ><img src=\"img/Delete2.jpg\" class=\"checkimg\"  /><input type=\"hidden\" name=\"checkid\" value=\"" + this.id + "\" /></div></div></div></div>");

            });
        }
        function DelItem1(id, article_id, evt) {

            //终止冒泡事件
            var e = (evt) ? evt : window.event; //判断浏览器的类型，在基于ie内核的浏览器中的使用cancelBubble
            if (window.event) {
                e.cancelBubble = true;
            } else {
                //e.preventDefault(); //在基于firefox内核的浏览器中支持做法stopPropagation
                e.stopPropagation();
            }

            alert(11111111111);
        }
        function DelItem(tab, id, evt) {
            //终止冒泡事件
            var e = (evt) ? evt : window.event; //判断浏览器的类型，在基于ie内核的浏览器中的使用cancelBubble
            if (window.event) {
                e.cancelBubble = true;
            } else {
                //e.preventDefault(); //在基于firefox内核的浏览器中支持做法stopPropagation
                e.stopPropagation();
            }
            alert(22222222222);
            Alert(tab);
            return false
        }
        //        function DeleteCollection(id, obj) {
        //            ajax.Detelearticle("id=" + id, function (data) {
        //                if (data.msg.toString() == "成功") 
        //                    obj.parent().parent().parent().hide(500);
        //                else 
        //                    Alert(data.msg.toString());
        //            });
        //        }
    </script>
</body>
</html>
